import mime from 'mime'

export function urlIsImage(url) {
    const filename = url.split('/').pop()
    return mime.getType(filename).startsWith('image/')
}

export function getDefaultModelVersion() {
    return 2
}

export function getCurrentPage() {
    const pages = getCurrentPages()
    return pages[pages.length - 1].$page
}

export function isMobile() {
    const { platform } = uni.getSystemInfoSync()
    const mobiles = ['android', 'ios']
    return mobiles.includes(platform)
}
